113df6
@@ -92,6 +92,7 @@
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hive.beeline.cli.CliOptionsProcessor;
+import org.apache.thrift.transport.TTransportException;
 
 /**
  * A console SQL shell with command completion.
@@ -1745,6 +1746,10 @@
void handleSQLException(SQLException e) {
       return;
     }
 
+    if (e.getCause() instanceof TTransportException) {
+      error(loc("hs2-unavailable"));
+    }
+
     error(loc(e instanceof SQLWarning ? "Warning" : "Error",
         new Object[] {
             e.getMessage() == null ? "" : e.getMessage().trim(),
